package com.aistar.common.config;

import com.aistar.common.util.IdWorker;
import com.aistar.common.util.JwtUtil;
import com.aistar.common.util.SMSCode;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author success
 * @version 1.0
 * @description:本类用来演示:相当于spring-bean.xml - >  管理一些第三方的bean
 * @date 2019/6/26 0026
 */
@Configuration
public class AppBeanConfig {
    /**
     *springboot中可以通过代码的方式来注册组件 - IdWorker
     * <bean id="idWorker" class="com.aistar.util.IdWorker"></>
     */
    @Bean
    public IdWorker idWorker(){
        return new IdWorker();
    }

    @Bean
    public SMSCode smsCode(){
        return new SMSCode();
    }

    @Bean
    public JwtUtil jwtUtil() {
        return new JwtUtil();
    }
}
